from datetime import datetime, timedelta

def fill_patient_info(fill_info):

 
    pyperclip.copy(fill_info)
    addr, id_no, contact_person, phone = fill_info.split()
    info_map = {
        "ward": "儿童消化心血管科",
        "province": "河南省",
        "city": "南阳市",
        "work": "其他",
        "marriage": "未婚",
        "nation": "汉族",
        "null": "无",
        "condition": "一般",
        "ralationship": "父母",
        "teller": "患者家属",
        "contact_person": contact_person,
        "addr": addr,
        "id_no": id_no,
        "phone": phone,
        "c": "c",
        "v1": "v1",
        "v2": "v2",
        "blank": ''
    }

    info_list = [
        'ward', 'blank', 'province', 'city', 'work', 'marriage', 'nation',
        'province', 'city', 'null', 'null', 'addr', 'id_no', 'contact_person',
        'condition', 'ralationship', 'c', 'phone', 'v1', 'addr', 'teller',
        'null', 'v2'
    ]
    pyautogui.click(1749, 200)
    for i in info_list:
        if i == 'c':
            pyautogui.hotkey('ctrl', 'a')
            pyautogui.hotkey('ctrl', 'c')
            date1 = pyperclip.paste()
            date1 = datetime.strptime(date1, '%Y.%m.%d %H:%M')
            date2 = date1 + timedelta(minutes=31)
            date3 = date1 + timedelta(minutes=56)
            date2 = datetime.strftime(date2, '%Y.%m.%d %H:%M')
            date3 = datetime.strftime(date3, '%Y.%m.%d %H:%M')

        elif i == 'v1':
            pyperclip.copy(date2)
            pyautogui.hotkey('ctrl', 'v')

        elif i == 'v2':
            pyperclip.copy(date3)
            pyautogui.hotkey('ctrl', 'v')
        elif not info_map[i]:
            pass
        else:
            pyperclip.copy(info_map[i])
            pyautogui.hotkey('ctrl', 'v')
        pyautogui.press('tab')